/*
 * @Description: UserRouter
 */
var express = require('express');
const UserController = require('../../controllers/admin/UserController');
var UserRouter = express.Router();
// 图片上传
const multer = require('multer')
const upload = multer({ dest: 'public/avataruploads/' })

UserRouter.post('/adminApi/user/login', UserController.login);//登录
UserRouter.post('/adminApi/user/upload', upload.single('file'), UserController.upload);//上传图片
UserRouter.post('/adminApi/user/add', upload.single('file'), UserController.add);//添加用户
UserRouter.get('/adminApi/user/list', UserController.getList);//获取用户列表
UserRouter.put('/adminApi/user/list/:id', UserController.updateOne);//更新用户列表
UserRouter.delete('/adminApi/user/list/:id', UserController.delOne);//删除一个用户列表的数据
UserRouter.get('/adminApi/user/list/:id', UserController.getList);//根据id获取用户

module.exports = UserRouter;
